package com.sykj.util.reponse;


import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.ResponseBody;

import java.lang.annotation.Annotation;

/**
 * @program: BeautyClub
 * @description:自定义数据格式
 * @author: qiaoli
 * @create: 2020-07-15 09:31
 */
@Data
@NoArgsConstructor
public class ResultBody implements ResponseBody {
    /**
     * 响应代码
     */
    private String code;

    /**
     * 响应消息
     */
    private String message;

    /**
     * 响应结果
     */
    private Object result;

    public ResultBody(Object result) {
        this(CommonEnum.SUCCESS, result);
    }

    public



    ResultBody(String code,String message,Object result) {
        this.code = code;
        this.message = message;
        this.result = result;
    }

    public ResultBody(String code,String message) {
        this.code = code;
        this.message = message;
    }

    public ResultBody(CommonEnum success, Object result) {
        this.code = success.getResultCode();
        this.message = success.getResultMsg();
        this.result = result;
    }
    public ResultBody(CommonEnum success) {
        this.code = success.getResultCode();
        this.message = success.getResultMsg();
    }


    @Override
    public Class<? extends Annotation> annotationType() {
        return null;
    }
}